home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
-
- int main(int argc, char *argv[])
- {
- char fn[80];
- int i,n;
- FILE *fp;
-
- if(--argc < 1) {
- printf("number of files required !\n");
- exit(EXIT_FAILURE);
- }
-
- n = atoi(argv[1]);
- for(i=0; i<n; i++) {
- sprintf(fn,"Testfile%d.txt",i);
- if(!(fp = fopen(fn,"w"))) {
- printf("cannot open %s !\n",fn);
- continue;
- }
- fputc('X',fp);
- fclose(fp);
- }
- }
-